<div class="box">
    <div class="box-header with-border">
        <h3 class="box-title">库存查询</h3>
    </div><!-- /.box-header -->
    <div class="box-body">
        <div class="col-md-3">
            <input type="text"
                   class="form-control"
                   ng-model="filters.name"
                   placeholder="物料名称"
                   aria-describedby="sizing-addon2">
        </div><!-- /.col-lg-6 -->
        <div class="col-md-3">
            <select type="text"
                   class="form-control"
                   ng-model="filters.category_id"
                    ng-options="category.id as category.name for category in categories"
            ></select>
        </div><!-- /.col-lg-6 -->
    </div>
    <div class="box-body table-responsive">
        <table ng-table="skuTable" show-filter="false" class="table table-striped">
            <tr ng-repeat="(index,sku) in $data">
                <td width="150"
                    data-title="'#'">
                    <span class="editable-text" ng-bind="sku.id"></span>
                </td>
                <td data-title="'物料名称'">
                    <span class="editable-text" ng-bind="sku.product.name"></span>
                </td>
                <td data-title="'分类'">
                    <span class="editable-text" ng-bind="sku.product.category.name"></span>
                </td>
                <td width="175"
                    data-title="'现有库存'">
                    <span class="editable-text" ng-bind="sku.quantity"></span>
                </td>
                <td width="175"
                    data-title="'物料单位'">
                    <span class="editable-text" ng-bind="sku.product.unit"></span>
                </td>
                <td data-title="'日期'">
                    添加日期: {{sku.created_at}}<br>
                    最后修改: {{sku.updated_at}}
                </td>
                <td width="150" data-title="'操作'">
                    <button class="btn btn-primary btn-sm"
                            ng-click="records(sku)"
                            title="进/出货记录"
                            data-toggle="tooltip">
                        <span class="glyphicon glyphicon-list"></span>
                    </button>
                </td>
            </tr>
            <tr ng-show="!$data.length">
                <td colspan="10" class="text-center">暂无相关物料</td>
            </tr>
        </table>
    </div><!-- /.box-body -->
    <div class="overlay" ng-show="skuTable.settings().$loading">
        <i class="fa fa-refresh fa-spin"></i>
    </div>
</div>
